/*
 * Copyright 2007 Stefan Arentz <http://stefan.arentz.nl>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sateh.spaces.simple;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class SimpleSpaceTemplate implements Serializable
{
    /**
     *
     */

    private Map<String,Object> properties = new HashMap<String, Object>();

    /**
     * 
     */

    private final String className;

    /**
     *
     */

    public SimpleSpaceTemplate(Object object)
    {
        this.className = object.getClass().getName();
        this.properties = SimpleSpaceUtils.getTemplateProperties(object);
    }

    /**
     *
     */

    public String getClassName()
    {
        return className;
    }

    /**
     *
     */

    public Set<String> keys()
    {
        return properties.keySet();
    }

    /**
     *
     */

    public void put(String name, Object value)
    {
        properties.put(name, value);
    }

    /**
     *
     */
    
    public Object get(String name)
    {
        return properties.get(name);
    }

    /**
     *
     */

    public boolean contains(String name)
    {
        return properties.containsKey(name);
    }
}
